package com.qdlc.p2p.biz.service;

import java.util.List;

import com.qdlc.p2p.dal.dto.BorrowMortgage;
import com.qdlc.p2p.dal.dto.BorrowUpload;

/**
 * 借款抵押物
 *
 * @author sj
 * @since 2014年8月24日
 */
public interface BorrowMortgageService {

    /**
     * 获取借款抵押物
     *
     * @param borrowId
     * @param status
     * @return
     */
    public List<BorrowMortgage> findByBorrowId(long borrowId, int status);

    /**
     * 根据抵押物id获取抵押物对象
     *
     * @param id
     * @return 抵押物对象
     */
    public BorrowMortgage findById(long id);

    public void updateBorrowMortgage(List<BorrowMortgage> borrowMortgageList, List<BorrowMortgage> bms, List<BorrowUpload> list);

    public int getMaxNumByBorrowId(long borrowId);

    public List<BorrowMortgage> findByBorrowIdAndNum(long id, int num);

    public List<BorrowMortgage> findByBorrowIdAndNumAndStatus(long id, int num, int status);

    public double getTotalMortgagePriceByBorrowId(long borrowId);

    public Object[] getTotalPriceByBorrowIdAndNum(long id, int num);

    /**
     * 查询入库状态的抵押物
     *
     * @param id
     * @param i
     * @return
     */
    public List<BorrowMortgage> findInByBorrowIdAndNum(long id, int i);

    /**
     * 添加资产包
     *
     * @param borrowMortgageList
     * @param list
     */
    public void addMortgage(List<BorrowMortgage> borrowMortgageList, List<BorrowUpload> list);

}
